package com.adteam.xmap.web;

import java.util.List;

import com.adteam.xmap.manager.ProcessManager;
import com.opensymphony.xwork2.ActionSupport;

public class ProcessAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	
	private ProcessManager processManager;
	
	private Process process;
	
	private List processes;
	
	private Integer id;

	@Override
	public String execute() throws Exception {
		
		processes = processManager.findAllProcesses();
		return "SUCCESS";
	}
	
	public String addInput() {
		
		return "add_input";
	}
	
	public String add() {
		
		processManager.addProcess(process);
		return "add_success";
	}
	
	public String del() {
		
		processManager.delProcess(id);
		return "del_success";
	}
	
	public String updateInput() {
		
		return "update_input";
	}
	
	public String update() {
		
		processManager.updateProcess(process);
		return "update_success";
	}
	
	public String find() {
		
		processManager.findProcessById(id);
		return "find_success";
	}

	public ProcessManager getProcessManager() {
		return processManager;
	}

	public void setProcessManager(ProcessManager processManager) {
		this.processManager = processManager;
	}

	public Process getProcess() {
		return process;
	}

	public void setProcess(Process process) {
		this.process = process;
	}

	public List getProcesses() {
		return processes;
	}

	public void setProcesses(List processes) {
		this.processes = processes;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	
}
